#include<stdio.h>

int main()
{
	int i,n,a[400][5],b[400],t=0;
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		scanf("%d",&a[i][0]);
		scanf("%d",&a[i][1]);
		scanf("%d",&a[i][2]);
		scanf("%d",&a[i][3]);
	}
	double average[400],maxinum;
	for (i=0;i<n;i++)
	{
		average[i]=(a[i][1]+a[i][2]+a[i][3])/3.0;
		printf("%.2lf\n",average[i]);
	}
	maxinum=average[0];
	for (i=0;i<n;i++)
		if (maxinum<average[i])
		{
			maxinum=average[i];
			b[t]=i;
		}
	for (i=0;i<n;i++)
		if (maxinum==average[i])
		{
			b[t]=i;
			t++;
		}
	for (i=0;i<t;i++)
	{
		printf("%d ",a[b[i]][0]);
		printf("%.2lf\n",average[b[i]]);
	}
	return 0;
}
